<script>
document.write(document.cookie);
var expires = new Date();
var year = expires.getYear();//获取年
var month = expires.getMonth();//获取月
var theDate = expires.getDate();//获取当前月第几日
var hour = expires.getHours();//获取小时
var minute = expires.getMinutes();//获取分钟
var second = expires.getSeconds();//获取秒


document.cookie = 'year=' + escape(year);
document.cookie = 'month=' + escape(month);
document.cookie = 'theDate=' + escape(theDate);
document.cookie = 'Hour=' + escape(hour);
document.cookie = 'Minute=' + escape(minute);
document.cookie = 'Second=' + escape(second);

function check () {
	var nowDate = new Date();
	var nowYear = nowDate.getYear();//获取年
	var nowMonth = nowDate.getMonth();//获取月
	var nowTheDate = nowDate.getDate();//获取当前月第几日
	var nowHour = nowDate.getHours();//获取小时
	var nowMinute = nowDate.getMinutes();//获取分钟
	var nowSecond = nowDate.getSeconds();//获取秒
	
	var cookieYear = getCookie('year');//获取年
	var cookieMonth = getCookie('month');//获取月
	var cookieTheDate = getCookie('theDate');//获取当前月第几日
	var cookieHour = getCookie('hour');//获取小时
	var cookieMinute = getCookie('minute');//获取分钟
	var cookieSecond = getCookie('second');//获取秒
	if ( nowYear > cookieYear)  {
		return true;
	}
	if ( nowMonth > cookieMonth)  {
		return true;
	}
	if ( nowTheDate > cookieTheDate)  {
		return true;
	}
	if ( nowHour > cookieHour)  {
		return true;
	}
	if ( nowMinute > cookieMinute)  {
		return true;
	}
	if ( (nowSecond-cookieSecond) > 5)  {
		return true;
	}
}
function getCookie (cookieName) {
	var cookieString = document.cookie;
	var start = cookieString.indexOf(cookieName + '=');
	if (start == -1) // 找不到
	return null;
	start += cookieName.length + 1;
	var end = cookieString.indexOf(';', start);
	if (end == -1) return unescape(cookieString.substring(start));
	return unescape(cookieString.substring(start, end));
}

check ();
</script>